using TripleA.Core.Interfaces.Entities;
using TripleA.Core.Interfaces.Exceptions;

namespace TripleA.Core.Extensions.Database
{
    public class SqlServerQueryStep<T> : SqlServerCommandStep<T>
        where T : Context
    {
        public override void PreValidate(T context)
        {
            if (Statement == null)
                throw new StepConfigurationException("Statement not set/provided");
        }

        public override void Execute(T context)
        {         
            var actual = ExecuteGetInt(context);
            AssertRowCount(actual);
        }
    }
}